package jjn.round1;

/**
 * @author Jjn
 * @since 2022/10/7 17:04
 */
public class LeetCode1800_MaxAscendingSubArray {
    public int maxAscendingSum(int[] nums) {
        int max = Integer.MIN_VALUE;
        for (int i = 0; i < nums.length; i++) {
            int circle = nums[i];
            int first = nums[i];
            for (int j = i + 1; j < nums.length; j++) {
                if (first >= nums[j]) {
                    break;
                } else {
                    first = nums[j];
                }
                circle += nums[j];
            }
            max = Math.max(max, circle);
        }
        return max;
    }
}
